<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <canvas id="canvas" style="border: 1px solid #aaa; display: block; margin: 50px auto;">
        当前浏览器不支持Canvas，请更换浏览器
    </canvas>
    <script>
        window.onload = function () {
            var canvas = document.getElementById("canvas");

            canvas.width = 800;
            canvas.height = 800;

            var context = canvas.getContext("2d");

            context.arc(400, 400, 300, 0.5 * Math.PI, 1.5 * Math.PI, true);
            context.moveTo(400, 100);
            context.arcTo(1200, 400, 400, 700, (400-100)*dist(400, 100, 1200, 400)/(1200-400));
            context.stroke();
        }

        function dist(x1, y1, x2, y2) {
            return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
        }
    </script>
</body>
</html>